<?php
class Picture_model extends Model {
	/**
	 * 添加景点图片
	 * @param unknown_type $cols
	 */
	public function add($id, $cols) {
		$dPicture = new Picture_data();
		
		return $dPicture->add($id, $cols);
	}
	/**
	 * 获取景点图片基本信息
	 * @param unknown_type $params
	 */
	public function pictureInfo($params) {
		$dPicture = new Picture_data();
		
		return $dPicture->PictureInfo($params);
	}
	/**
	 * 删除景点图片
	 * @param unknown_type $node
	 */
	public function del($params) {
		$dPicture = new Picture_data();
		
		return $dPicture->del($params);
	}
	/**
	 * 分页获取景点图片
	 * @param unknown_type $page
	 * @param unknown_type $size
	 * @param unknown_type $params
	 */
	public function page($page = 1, $size = 20, $params = array()) {
		$dPicture = new Picture_data();
		$num = $dPicture->count($params);
		if($num === false) return false;
		if($num == 0) return array('num' => $num, 'data' => array(), 'page' => $page, 'size' => $size);
		
		$data = $dPicture->page($page, $size, $params, $orderby = '`id` DESC');
		if($data === false) return false;
		
		return array('num' => $num, 'data' => $data, 'page' => $page, 'size' => $size);
	}
}